import Vue from 'vue'
import Router from 'vue-router'

// in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
// detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading

Vue.use(Router)

/* Layout */
import Layout from '../views/layout/Layout'

/**
* hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true               if set true, will always show the root menu, whatever its child routes length
*                                if not set alwaysShow, only more than one route under the children
*                                it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect           if `redirect:noredirect` will no redirct in the breadcrumb
* name:'router-name'             the name is used by <keep-alive> (must set!!!)
* meta : {
    title: 'title'               the name show in submenu and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar,
  }
**/
export const asyncRouterMap = {
  //消息推送
  push_add: () => import('@/views/push/add'),
  //推送列表
  push_table: () => import('@/views/push/table'),
  //活动配置
  activity_edit: () => import('@/views/activity/edit'),
  //活动列表
  activity_table: () => import('@/views/activity/table'),
  //资讯发布
  advisory_add: () => import('@/views/advisory/add'),
  //资讯审核
  advisory_review: () => import('@/views/advisory/review'),
  //资讯列表
  advisory_table: () => import('@/views/advisory/table'),
  //发布研学实践
  research_add: () => import('@/views/research/add'),
  //研学实践列表
  research_list: () => import('@/views/research/list'),
  //发布研学资讯
  research_publish: () => import('@/views/research/publish'),
  //研学资讯列表
  research_information: () => import('@/views/research/information'),
  //发布研学资讯
  research_policy: () => import('@/views/research/policy'),
  //研学资讯列表
  research_policyList: () => import('@/views/research/policyList'),
  //创建升学路径
  path_add: () => import('@/views/path/add'),
  //升学路径列表
  path_list: () => import('@/views/path/list'),
  //版本管理
  version_list: () => import('@/views/version/list'),
  //商品发布
  goods_create: () => import('@/views/goods/create'),
  //商品列表
  goods_list: () => import('@/views/goods/list'),
  //添加课程
  curriculum_add: () => import('@/views/curriculum/add'),
  //课程列表
  curriculum_list: () => import('@/views/curriculum/list'),
  // 直播管理
  'curriculum_live-list': () => import('@/views/live/list'),
  // 添加直播
  'curriculum_live-add': () => import('@/views/live/add'),
  //用户管理
  user_list: () => import('@/views/user/list'),
  //创建用户
  user_add: () => import('@/views/user/add'),
  //创建vip类型
  vip_add: () => import('@/views/vip/add'),
  //vip类型列表
  vip_type: () => import('@/views/vip/type'),
  //vip卡列表
  vip_card: () => import('@/views/vip/card'),
  //vip用户列表
  vip_list: () => import('@/views/vip/list'),
  //意见反馈
  config_suggestion: () => import('@/views/config/suggestion'),
  // 高校咨询
  'config_advisory-academy': () => import('@/views/advisoryAcademy/list'),
  // 文件管理
  'config_files': () => import('@/views/config/file'),
  //广告素材
  config_advertising: () => import('@/views/config/advertising'),
  //资讯标签
  config_labels: () => import('@/views/config/labels'),
  //资讯栏目
  config_advisorySection: () => import('@/views/config/advisorySection'),
  //课程主题
  config_course: () => import('@/views/config/course'),
  //配置学校
  config_school: () => import('@/views/config/school'),
  //配置年级
  config_grade: () => import('@/views/config/grade'),
  //配置科目
  config_subject: () => import('@/views/config/subject'),
  //首页院校
  config_recommend: () => import('@/views/config/recommend'),
  //行政区域
  config_adminArea: () => import('@/views/config/adminArea'),
  //敏感词库
  config_sensitiveLexicon: () => import('@/views/config/sensitiveLexicon'),
  //账户管理
  config_employee: () => import('@/views/config/employee'),
  //机构列表
  organize_list: () => import('@/views/organize/list'),
  //机构入住
  organize_join: () => import('@/views/organize/join'),
  //评论列表
  community_comment: () => import('@/views/community/comment'),
  //帖子列表
  community_post: () => import('@/views/community/post'),
  //审核开关
  community_switch: () => import('@/views/community/switch'),
  //专家问答
  expert_question:() => import('@/views/expert/question'),
  //专家列表
  expert_list:() => import('@/views/expert/list'),
  //专题列表
  special_topicList:() => import('@/views/special/topicList'),
  //新增专题
  special_addTopic:() => import('@/views/special/addTopic'),
  //市场人员
  marketer_account:() => import('@/views/marketer/account'),
  //关联院校
  marketer_school:() => import('@/views/marketer/school'),
  //关联高中
  marketer_highSchool:() => import('@/views/marketer/highSchool'),
  //院校列表
  academy_list:() => import('@/views/academy/list'),
  //审核清单
  academy_audit:() => import('@/views/academy/audit'),
  //审核记录
  academy_myaudit:() => import('@/views/academy/myaudit'),
  //创建院校
  academy_add:() => import('@/views/academy/add'),
  //高中列表
  highSchool_list:() => import('@/views/highSchool/list'),
  //教师列表
  highSchool_teacher:() => import('@/views/highSchool/teacher'),
  //需求对接
  highSchool_demand:() => import('@/views/highSchool/demand'),
  //发布教师热点
  miniProgram_addHotNews:() => import('@/views/miniProgram/addHotNews'),
  //教师热点列表
  miniProgram_hotNewsList:() => import('@/views/miniProgram/hotNewsList'),
  //志愿用户信息
  zyInfo_info:() => import('@/views/zyInfo/info'),
  //资讯页面
  consultation_list:()=> import('@/views/consultation/list')
}
export const constantRouterMap = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/auth-redirect',
    component: () => import('@/views/login/authredirect'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/errorPage/404'),
    hidden: true
  },
  {
    path: '',
    component: Layout,
    redirect: 'dashboard',
    children: [
      {
        path: 'dashboard',
        component: () => import('@/views/dashboard/index'),
        name: 'Dashboard',
        meta: { title: '主页', icon: 'dashboard', noCache: true }
      }
    ]
  },
  
]
export default new Router({
  mode: 'history', //后端支持可开
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})

